﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Business
{
    public class PhongBan
    {
       
        public int MaPB { get; set; }
        public string TenPB { get; set; }
        

       
        public PhongBan (int maPb, string tenPb)
        {
            this.MaPB=maPb;
            this.TenPB=tenPb;
        }
        

       
        public static List<PhongBan> LayDanhSach()
        {
            DataAccess.KhoBanHangDataContext db = new DataAccess.KhoBanHangDataContext();
            return (from p in db.PhongBans
                    select new PhongBan(p.MaPB, p.TenPB)).ToList();
        }
        
    }
}
